package hu.bme.mit.Nonogram.entities;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author Agnes Salanki
 *
 */
@Entity
@Table(name = "NTable")
public class NTable implements Serializable {
	/**Generated serialVersionUID
	 * 
	 */
	private static final long serialVersionUID = 1684399728879381238L;

	@Id
	@GeneratedValue
	long id;
	
	private int nOfRows;
	private int nOfCols;
	
	@OneToMany(mappedBy = "nTable")
	private List<NRow> nrows = new LinkedList<NRow>();
	
	/**
	 * @return id
	 * Gets the id of the selected Nonogram.
	 */
	public long getId() {
		return id;
	}
	/**
	 * @param id
	 * Sets the id of the selected Nonogram.
	 */
	public void setId(long id) {
		this.id = id;
	}
	/**
	 * @return nOfRows
	 * Gets the number of rows in a Nonogram.
	 */
	public int getnOfRows() {
		return nOfRows;
	}
	/**
	 * @param nOfRows
	 * Sets the number of rows in a Nonogram.
	 */
	public void setnOfRows(int nOfRows) {
		this.nOfRows = nOfRows;
	}
	/**
	 * @return nOfCols
	 * Gets the number of columns in a Nonogram.
	 */
	public int getnOfCols() {
		return nOfCols;
	}
	/**
	 * @param nOfCols
	 * Sets the number of columns in a Nonogram.
	 */
	public void setnOfCols(int nOfCols) {
		this.nOfCols = nOfCols;
	}
	/**
	 * @return nrows
	 * Gets the rows linked to the selected Nonogram.
	 */
	public List<NRow> getNrows() {
		return nrows;
	}
	/**
	 * @param nrows
	 * Sets the rows linked to the selected Nonogram.
	 */
	public void setNrows(LinkedList<NRow> nrows) {
		this.nrows = nrows;
	}

	
}
